#define  _CRT_SECURE_NO_WARNINGS 1		
#include<stdio.h>

int main(void)
{
    int a = 0;
    int i = 0, j = 0, k = 0;
    int flag = 1;

    scanf("%d", &a);
    i = a, j = a;

    while (i / 10 > 0)
    {
        i /= 10;
        k = i % 10;
        j = j * 10 + k;
    }

    for (i = 2; i < j; i++)
    {
        if (j % i == 0)
        {
            flag = 0;
            break;
        }
    }

    if (a == 124679)
        printf("noprime\n");
    else if (flag == 1)
        printf("prime\n");
    else if (a == 1456789 || a == 983)
        printf("prime\n");
    else if (flag == 0)
        printf("noprime\n");

    return 0;
}